<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="./adminHead.jsp"%>
<html>
<head>
    <title>分类管理</title>
    <style type="text/css">
        .table tbody tr td{
            vertical-align: middle;
        }
        th{
            text-align: center;
            font-size: 24px;
        }
        td{
            text-align: center;
            font-size: 20px;
        }
        #queryData{
            height: 50px;
            width: 650px;
            font-size: 30px;
        }
        .myBt{
            height: 50px;
            width: 100px;
        }
        .myHead{
            width: 99%;
            margin: 1%;
        }
        .mySelect{
            height: 40px;
            width: 120px;
            font-size: 20px;
        }
    </style>
    <script type="text/javascript">
        function foo(){
            if(confirm("确认删除吗？")){
                return true;
            }
            return false;
        }
    </script>
</head>
<body>
<div class="col-md-9">
    <div class="row myHead">
        <form method="get" action="${pageContext.request.contextPath}/jsp/admin/class.do">
            <div class="col-md-6 text-right">
                <input type="hidden" name="method" value="query">
                <input type="text" class="form-control" id="queryData" name="queryData" placeholder="请在此处输入搜索内容" value=""/>
            </div>
            <div class="col-md-3 text-center">
                <span style="font-size: 25px">查找方式：</span>
                <select class="form-select mySelect" aria-label="Default select example" name="selectChoice">
                    <option value="bCode">编码</option>
                </select>
            </div>
            <div class="col-md-3 text-left">
                <div class="col-md-4">
                    <input type="submit" class="btn btn-lg btn-primary myBt" value="搜索"/>
                </div>
                <div class="col-md-4">
                    <input type="reset" class="btn btn-lg btn-primary myBt" value="重置"/>
                </div>
                <div class="col-md-4">
                    <a href="${pageContext.request.contextPath}/jsp/admin/class.do?method=toAdd&bid=${book.id}">
                        <input type="button" class="btn btn-lg btn-primary myBt" value="添加分类"/>
                    </a>
                </div>
            </div>
        </form>
    </div>
    <div class="row">
        <c:if test="${tips != null}">
            <div class="alert alert-success" role="alert">
                <span class="glyphicon glyphicon-ok" aria-hidden="true"></span>
                <span class="sr-only">Yes:</span>${tips}
            </div>
        </c:if>
        <c:if test="${error != null}">
            <div class="alert alert-danger" role="alert">
                <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
                <span class="sr-only">Error:</span>${error}
            </div>
        </c:if>
        <table class="table table-hover table-bordered">
            <tr>
                <th width="15%">编号</th>
                <th width="15%">书名</th>
                <th width="15%">作者</th>
                <th width="15%">出版社</th>
                <th width="20%">分类</th>
                <th width="20%">操作</th>
            </tr>
            <tbody>
            <c:forEach var="class_" items="${classList}" varStatus="status">
                <tr>
                    <td>
                        <span>${book.id}</span>
                    </td>
                    <td>
                        <span>${book.name}</span>
                    </td>
                    <td>
                        <span>${book.author}</span>
                    </td>
                    <td>
                        <span>${book.press}</span>
                    </td>
                    <td>
                        <span>${class_.bClass}</span>
                    </td>
                    <td>
                        <a href="${pageContext.request.contextPath}/jsp/admin/class.do?method=delete&bid=${book.id}&bclass=${class_.bClass}" onclick="return foo()">
                            <input type="button" class="btn btn-lg btn-danger" value="删除">
                        </a>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
</div>

</body>
</html>
